package model;

public class Field {
	public static final byte WHITE = 0;
	public static final byte BLACK = 1;
	public static final byte EMPTY = 2;
	// enums in Java allow methods and values, an enum can know it's location if you were to set it.
	// Which might be a solution to some problems we may encounter.
	

	public static byte opponent(byte player)
	{
		return player == WHITE ? BLACK : 
			   player == BLACK ? WHITE : EMPTY;
	}
	
	public static String toString(byte player)
	{
		switch(player)
		{
		case WHITE:
			return "White";
		case BLACK:
			return "Black";
		default:
			return "Nobody";
		}
	}
	
	public static String toChar(byte player)
	{
		switch(player)
		{
		case WHITE:
			return "w";
		case BLACK:
			return "b";
		default:
			return " ";
		}
	}
	
	public static byte[] values()
	{
		byte[] vals = {WHITE, BLACK, EMPTY};
		return vals;
	}
	
	public static byte[] colors()
	{
		byte[] vals = {WHITE, BLACK};
		return vals;
	}
}
